import { toRefs } from 'vue'

export default {
  menuCollapseHooks: {} as Record<number, () => any>,
  menuCollapseHooksExecute() {
    Object.keys(this.menuCollapseHooks).forEach(uid => {
      const func = Reflect.get(this.menuCollapseHooks, uid)
      func()
    })
  },
  onMenuCollapse(hook: () => any, uid: number) {
    Reflect.set(this.menuCollapseHooks, uid, hook)
  },
  menuCollapseHookRemove(uid: number) {
    delete this.menuCollapseHooks[uid]
  },

}
